#include <stdio.h>

int Ack( int m, int n );

int main()
{
    int m, n;

    scanf("%d %d", &m, &n);
    printf("%d\n", Ack(m, n));

    return 0;
}

/* 你的代码将被嵌在这里 */

int Ack ( int m, int n ) {
    int result;
    if ( m < 0 && n < 0 ) {
        result = 0;
    } else if ( m == 0 ) {
        result = n + 1;
    } else if ( n == 0 ) {
        result = Ack(m-1,1);
    } else {
        result = Ack(m-1,Ack(m,n-1));
    }
    return result;
}